package cn.yuanqiao.archive.storeRoom.service.impl;

import cn.yuanqiao.archive.appManager.domain.DataScopeBase;
import cn.yuanqiao.archive.storeRoom.domain.OutInLogs;
import cn.yuanqiao.archive.storeRoom.mapper.OutInLogsMapper;
import cn.yuanqiao.archive.storeRoom.service.IOutInLogsService;
import cn.yuanqiao.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 出入库日志Service业务层处理
 * 
 * @author xy
 * @date 2023-06-30
 */
@Service
public class OutInLogsServiceImpl implements IOutInLogsService
{
    @Autowired
    private OutInLogsMapper outInLogsMapper;

    /**
     * 查询出入库日志
     * 
     * @param id 出入库日志主键
     * @return 出入库日志
     */
    @Override
    public OutInLogs selectOutInLogsById(Long id)
    {
        return outInLogsMapper.selectOutInLogsById(id);
    }

    /**
     * 查询出入库日志列表
     * 
     * @param outInLogs 出入库日志
     * @return 出入库日志
     */
    @Override
    public List<OutInLogs> selectOutInLogsList(OutInLogs outInLogs)
    {
        return outInLogsMapper.selectOutInLogsList(new DataScopeBase(),outInLogs);
    }

    /**
     * 新增出入库日志
     * 
     * @param outInLogs 出入库日志
     * @return 结果
     */
    @Override
    public int insertOutInLogs(OutInLogs outInLogs)
    {
        outInLogs.setCreateTime(DateUtils.getNowDate());
        return outInLogsMapper.insertOutInLogs(outInLogs);
    }

    /**
     * 修改出入库日志
     * 
     * @param outInLogs 出入库日志
     * @return 结果
     */
    @Override
    public int updateOutInLogs(OutInLogs outInLogs)
    {
        return outInLogsMapper.updateOutInLogs(outInLogs);
    }

    /**
     * 批量删除出入库日志
     * 
     * @param ids 需要删除的出入库日志主键
     * @return 结果
     */
    @Override
    public int deleteOutInLogsByIds(Long[] ids)
    {
        return outInLogsMapper.deleteOutInLogsByIds(ids);
    }

    /**
     * 删除出入库日志信息
     * 
     * @param id 出入库日志主键
     * @return 结果
     */
    @Override
    public int deleteOutInLogsById(Long id)
    {
        return outInLogsMapper.deleteOutInLogsById(id);
    }
}
